package com.yl.auth.controller;


import com.yl.auth.model.entity.Danganguanli;
import com.yl.auth.service.DanganguanliService;
import com.yl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.InputStream;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yl
 * @since 2023-06-17
 */
@RestController
@RequestMapping("/admin/auth/danganguanli")
@Api(tags = "市场销售-档案管理")
public class DanganguanliController {


    @Resource
    private DanganguanliService danganguanliService;

    @GetMapping("/findAll")
    @ApiOperation(value = "查看全部数据信息")
    public Result findAll() {
        List<Danganguanli> list = danganguanliService.list();
        return Result.ok(list);
    }
//    @ApiOperation(value = "上传文件")
//    @PostMapping("/import")
//    public Result bathImport(@ApiParam(value = "Excel文件",required = true)
//                             @RequestParam("file")MultipartFile file) {
//        try {
//            InputStream inputStream = file.getInputStream();
//            danganguanliService.importData(inputStream);
//            return Result.ok().message("批量导入成功!");
//        }catch (Exception e) {
//            return Result.ok().message("批量导入失败!");
//        }
//    }


}

